package com.mt;

import com.lovo.maotai.dao.IStaticPageDao;
import com.lovo.maotai.entity.StaticPageEntity;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootTest(classes = com.lovo.MaotaiMain.class)
public class MtTesat {

    @Autowired
    private IStaticPageDao staticPageDao;
    @Autowired
    private RedisTemplate redisTemplate;
   @Test
    public void sava(){
        String str="  <el-row>\n" +
                "         <el-col :span=\"12\"><div class=\"grid-content bg-purple\">\n" +
                "           茅台酒1000一瓶抢购\n" +
                "         </div></el-col>\n" +
                "         <el-col :span=\"12\"><div class=\"grid-content bg-purple-light\">\n" +
                "         </div></el-col>\n" +
                "       </el-row>";
       StaticPageEntity spg=new StaticPageEntity();
       spg.setPageId("1");
       spg.setPageTitle("mt");
       spg.setPageInfo(str);
       staticPageDao.delete(staticPageDao.findById("1").get());
        staticPageDao.save(spg);
    }
    @Test
    public void  savaMT(){
       redisTemplate.delete("mt");
       redisTemplate.opsForValue().set("mt",100);
    }
}
